<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="css/login.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/footer.css">
    <script src="js/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
</head>

<body>
<div id="app">
    <div class="container-fluid" style="padding: 0px;">
        <div class="login-header">
            <div class="header-box">
                <div class="logo"></div>
                <div class="title"></div>
            </div>
        </div>
        <div class="login-context">
            <div class="login-context-box">
                <div class="login-from" style="height: 500px;">
                    <div class="from-title">
                        <div @click="show=false">用户注册</div>

                    </div>
                    <div class="from-content" v-if="!show">
                        <div class="input-group ">
                            <input type="text" class="form-control" v-model="userinfo.username"
                                   placeholder="用户名">
                        </div>
                        <div class="input-group ">
                            <input type="password" class="form-control" v-model="userinfo.password"
                                   placeholder="请输入密码">
                        </div>
                        <div class="input-group ">
                            <input type="password" class="form-control" v-model="userinfo.pwd2"
                                   placeholder="再次输入密码">
                        </div>
                        <div style="float: right">
                            <a href="login.html">已有账号，去登录</a>
                        </div>
                        <br/>
                        <div class="from-check">
                            <div><input type="checkbox" name="	" id=""></div>
                            <div>&ensp;我以阅读以下条款：《唯品会服务条款》</div>
                        </div>
                        <button type="submit" class="btn form-control" @click="submit"
                                style="height: 54px; background-color: #f10180; color: #ffffff; margin-top: 20px;">注册
                        </button>
                    </div>

                </div>
            </div>
        </div>
        <!-- 底部 -->
        <div class="login-footer" style="margin-top: 60px;">
            <div>
                <img style="display:block;margin: 0 auto;"
                     src="https://shop.vipstatic.com/img/common/footer_common_20200705-hash-2a8e96cf.png" alt="">
            </div>
            <div style="display: flex; text-align: center; margin-top: 50px;">
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
                <div style="flex: 1;">
                    <p>服务保障</p>
                    <ul class="footer-text">
                        <li>正品保证</li>
                        <li>7天无理由放心退</li>
                        <li>7x15小时客户服务</li>
                        <li>7天无理由随心换</li>
                    </ul>
                </div>
            </div>
            <div class="txt" style="text-align: center; margin-top: 20px;">
                <p>Copyright © 2008-现在 vip.com，All Rights Reserved 使用本网站即表示接受 唯品会用户协议。版权所有 广州唯品会电子商务有限公司</p>
                <p>粤公网安备 44010302111111号 粤ICP备08114786号 增值业务经营许可证：粤B2-20170777 网络文化经营许可证：粤网文〔2021〕2056-282号</p>
                <p>经营主体证照 风险监测信息 互联网药品信息服务资格证书：（粤）-经营性-2018-0271 网络食品交易第三方平台备案凭证：粤B2-20170777 医疗器械网络交易服务第三方平台备案
                </p>
                <p>凭证：（粤）网械平台备字[2019]第00001号 出版物网络交易平台服务经营备案证：粤新出网备（2021）1号 未成年人关怀专区</p>
                <p>违法和不良信息举报电话：4006789888 算法推荐违规举报电话：4006789888</p>
            </div>

        </div>
    </div>
</div>
</body>
<script>
    const App = {
        data() {
            return {
                show: false,
                userinfo: {
                    username: '',
                    password: '',
                    pwd2: ''
                }
            }
        },
        methods: {
            submit() {
                axios({
                    url: 'http://localhost:8080/shopping_war/regist',
                    method: 'post',
                    data: this.userinfo
                }).then(res => {
                    if (res.data == "success") {
                        alert("注册成功");
                        setTimeout(() => {
                            window.location.href = "http://localhost:8080/shopping_war/login.html"
                        })
                    } else {
                        let msg = "注册失败"

                        alert(msg);
                    }
                })
            }
        }
    }
    Vue.createApp(App).mount('#app')
</script>
</html>
